package com.asset.dispoal.defaultRoleDepartment.service;

import com.asset.dispoal.defaultRoleDepartment.api.IGbDefaultRoleDepartmentService;
import com.asset.dispoal.defaultRoleDepartment.dto.GbDefaultRoleDepartmentRequest;
import com.asset.dispoal.defaultRoleDepartment.dto.GbDefaultRoleDepartmentResponse;
import com.asset.dispoal.defaultRoleDepartment.service.commom.GbDefaultRoleDepartmentDelete;
import com.asset.dispoal.defaultRoleDepartment.service.commom.GbDefaultRoleDepartmentInsert;
import com.asset.dispoal.defaultRoleDepartment.service.commom.GbDefaultRoleDepartmentQuery;
import com.asset.dispoal.defaultRoleDepartment.service.commom.GbDefaultRoleDepartmentUpdate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;


/**
 * 默认用户权限服务实现类
 *
 * @author: mhuang
 * @date: 2022-03-21 13:21:14
 */
@Service
public class GbDefaultRoleDepartmentServiceImpl implements IGbDefaultRoleDepartmentService {

    @Autowired
    GbDefaultRoleDepartmentInsert gbDefaultRoleDepartmentInsert;

    @Autowired
    GbDefaultRoleDepartmentUpdate gbDefaultRoleDepartmentUpdate;

    @Autowired
    GbDefaultRoleDepartmentDelete gbDefaultRoleDepartmentDelete;

    @Autowired
    GbDefaultRoleDepartmentQuery gbDefaultRoleDepartmentQuery;

    @Override
    public Result insert(GbDefaultRoleDepartmentRequest gbDefaultRoleDepartmentRequest) {
        return gbDefaultRoleDepartmentInsert.execute(gbDefaultRoleDepartmentRequest);
    }

    @Override
    public Result update(GbDefaultRoleDepartmentRequest gbDefaultRoleDepartmentRequest) {
        return gbDefaultRoleDepartmentUpdate.execute(gbDefaultRoleDepartmentRequest);
    }

    @Override
    public Result delete(String type) {
        gbDefaultRoleDepartmentDelete.execute(type);
        return Result.ok();
    }

    @Override
    public Result<GbDefaultRoleDepartmentResponse> queryByCompanyType(String type) {
        return gbDefaultRoleDepartmentQuery.execute(type);
    }
}